#include "gameroom.h"
#include <QIcon>
#include <QPainter>
#include <QIcon>
#include <QPushButton>
#include <QFont>
#include <QSound>

GameRoom::GameRoom(QWidget *parent) : QWidget(parent)
{
    //设置窗口的图标
    this->setWindowIcon(QIcon(":res/icon.png"));
    //设置窗口的标题
    this->setWindowTitle("游戏界面");
}

void GameRoom::paintEvent(QPaintEvent *event)
{
    (void)event;
    //绘制游戏界面
    QPainter painter(this);
// //    QPixmap pix(":res/game_room.png");
//    painter.drawPixmap(0,0,QPixmap(":res/icon.png"));
    QPixmap pixmap;
    //绘制游戏区域
    pixmap.load(":res/game_room.png");
    painter.drawPixmap(0,0,800,700,pixmap);
    //绘制控制区域和得分区域
    pixmap.load(":res/bg1.png");
    painter.drawPixmap(800,0,200,800,pixmap);


}
